NPC Script
Home : Game : Map Maker : Sprite Maker : Enemies : NPC Script
An NPC (Non-Player Character) Script usually contains the following elements:
The STARTMODE # and ENDMODE commands tell when the script is to begin and in what mode. You can include several scripts in one file.
The first line in any NPC script file (.npc) is line 1, which means that any IDE with row numbers can help you a great deal.
NOTE: Most of these commands have to be typed with the exact number of characters as shown by the numbers.
Any exceptions are usually noted with a “...” which means any number of characters can be used with that function.
An example of correct notation is as follows:
SAY 02 02 000 050 Hello everyone!
This command will display “Hello everyone!” in 8-bit text at Row 2, Column 2 with each character shown every 50 milliseconds.
|
BATTLE 1 222 333 |
|
Initiates a battle.
|
|
BOX 1 222 333 444 555 666 777 888 |
|
Places a box on the screen.
|
|
CASH 122222 333 |
|
Adds or takes away gold.
|
|
CCHECK 11 22 |
|
Displays your gold total in 8-bit text.
|
|
CHOICE 1 22 33 444 555 6... |
|
Places 8-bit text on the screen as a choice.
|
|
CHOOSE |
|
Activates the choice-maker. Note: in the game, make your choice with the up and down keys and press SPACE to make a selection. |
|
COLLECT 1.. 222 |
|
Places item in inventory.
|
|
ENDMODE |
|
Ends the NPC interaction and returns the player to the game. |
|
GOTO 111 |
|
Takes the player to the given line in the script.
|
|
HEALTH 1222 |
|
Adds or takes away HP.
|
|
IFCHOICE 1 222 |
|
Checks whether a certain choice was made. If so, the NPC script goes to a certain line.
|
|
IFDATE 1 22334444 55 |
|
Checks whether it is a certain month, day, and/or year. If so, the NPC script goes to a certain line.
|
|
IFLOC 1... 2... |
|
Checks whether you're in a certain mapfile. If so, executes a code.
|
|
IFLOOK 1 222 |
|
Checks whether you're looking up(0), left(1), down(2), or right(3). If so, takes you to the given line.
|
|
IFRAND 11 222 |
|
Checks for a certain random number. If it matches, the NPC script goes to a certain line.
|
|
IFTIME 1 2233 4455 777 |
|
Checks the time. If the time matches the specifications, the NPC script goes to a certain line.
|
|
IFVAR122 33333 444 555 |
|
Checks for a certain variable value in the NPC variable set and goes to a certain line accordingly.
|
|
IFWEEK 1111111 222 |
|
Checks for a certain day of the week and goes to the line if true.
|
|
INVGET 1... 222 |
|
Places an item in your inventory.
|
|
INVGIVE 1... 222 |
|
Takes an item away from your inventory.
|
|
NEWMODE 1 |
|
Jumps to a new mode in the script.
|
|
PAUSE 1111 |
|
Delays the script.
Note: PAUSE 0000 will stop the script until a user presses a key. |
|
SAY 11 22 333 444 5... |
|
Places 8-bit text on the screen.
|
|
SCREENSHOT |
|
Displays the screen. |
|
SETRAND 11 22 |
|
Generates a random number between two positive integers between 01-99.
|
|
SPACE |
|
Takes the character to the space screen. |
|
SPCODE 11 22 333 |
|
Changes a sprite in the map.
Note: This change is only temporary, and unless a WRITE command is used, will be reveresed when you leave the map. |
|
SPRITE 1 2... 333 444 |
|
Places a sprite on the screen.
|
|
SPWEAPON 1 |
|
Gives you a special weapon, albeit only temporary until you leave the game.
|
|
STARTMODE 1 |
|
Begins any script. This line is essential in an NPC script and should be the very first line.
|
|
VAR 11 233333 |
|
Changes an NPC variable.
|
|
WARP 11 22 33 44 5... |
|
Takes the player to a specified map.
|
|
WRITE 1... |
|
Writes to the game file (.qst) concerning sprites and NPC characters.
|
|
1... 22 33 444 |
|
Changes a sprite on any map. Such changes stay with that .qst file.
|
|
@ 1 2... |
|
Changes NPC character attributes. Such changes stay with that .qst file. |
|
S1 |
|
Sets special weapons. Such changes stay with that .qst file.
|